// 定义struct，并且具有方法
package main

import (
	"ant-learn-go/structs"
	"fmt"
	"log"
)

func vehicleRun(vehicle structs.Vehicle) {
	vehicle.RunWithSpeed(100)
}

func main() {
	var car structs.Car
	err := car.SetName("xuetielong")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(car)

	var bus structs.Bus
	err = bus.SetName("kakabus")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(bus)

	vehicleRun(car)
	vehicleRun(bus)
}
